﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;

namespace wmkMacro
{
    public class RecordStep
    {
        private MouseEventArgs mouseEvent;
        private KeyEventArgs keyboardEvent;

        public Int64 Delay { get; set; }
        public RecordAction Action { get; set; }
        public EventArgs Event{
            get { return this.mouseEvent == null ? (EventArgs)this.keyboardEvent : this.mouseEvent; }
            set
            {
                    if (value.GetType().IsSubclassOf(typeof(MouseEventArgs)))
                        this.mouseEvent = (MouseEventArgs)value;
                    else
                        this.keyboardEvent = (KeyEventArgs)value;
            }
        }

        public RecordStep(RecordAction action, EventArgs eventArg) : this(action, eventArg, 0) { }

        public RecordStep(RecordAction action, EventArgs eventArg, Int64 delay)
        {
            this.Action = action;
            this.Event = eventArg;
            this.Delay = delay;
        }
    }
}
